<%@page import="warehouse.SupplyBean"%>
<%@page import="warehouse.OrderBean"%>
<%@page import="java.sql.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>添加供货记录的功能实现</title>
	<link rel="stylesheet" href="layui/css/layui.css">
	<script src="layui/layui.js"></script>
</head>
<body>

<%
	String supplierNoString = request.getParameter("supplierNo");
	String cargoNoString = request.getParameter("cargoNo");
	String supplyNumString = request.getParameter("supplyNum");
	
	
	//如果参数不足则跳转回去
	if(supplierNoString==null||cargoNoString==null||supplyNumString==null){
		response.sendRedirect("supply_form.jsp");
		return;
	}
	//参数转换
	int supplierNo = Integer.valueOf(supplierNoString);
	int cargoNo = Integer.valueOf(cargoNoString);
	int supplyNum = Integer.valueOf(supplyNumString);
	//添加供应记录
	try{
		SupplyBean.addSupply(supplierNo, cargoNo, supplyNum);
		response.sendRedirect("supply_list.jsp");
	}catch(SQLException e){
		%>
		<script type="text/javascript">
			alert("记录添加失败");
		</script>
		<%
	}
%>


</body>
</html>